﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="createhostnamedsite.aspx.cs" Inherits="SharePointHNSC.ApplicationPages.CreateHostNamedSitePage" MasterPageFile="~/_admin/admin.master" %>

<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="AdminControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint.ApplicationPages.Administration" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/15/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/15/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/15/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="TemplatePickerControl" src="~/_controltemplates/15/TemplatePickerControl.ascx" %>

<asp:Content contentplaceholderid="PlaceHolderPageTitle" runat="server">
	<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_pagetitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
    <img class="logo" src="/_layouts/15/images/SharePointHNSC/Logo.jpg" alt="HSNC Logo"/><SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_pagetitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>
<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">

    <style>
        .logo{
            vertical-align:middle;
            padding:0px 25px 0px 10px;
        }
    </style>

<script type="text/javascript">
    // <![CDATA[
    function ULS9xi() { var o = new Object; o.ULSTeamName = "SharePoint HSNC"; o.ULSFileName = "createhostnamedsite.aspx"; return o; }
    function OnQuotaTemplateChange() {
        ULS9xi:;
        var idHidden;
        var selectedIndex = (document.getElementById("<%= DdlQuotaTemplate.ClientID %>")).selectedIndex;
        if (selectedIndex >= 0) {
            var index = (document.getElementById("<%= DdlQuotaTemplate.ClientID %>")).options[selectedIndex].value;
		    idHidden = "HidQTMaxStorage" + index;
		    if (document.getElementById(idHidden) != null) {
		        document.getElementById("LabelQTStorageLimit").innerHTML = STSHtmlEncode(document.getElementById(idHidden).value);
		    }
		    idHidden = "HidQTMaxUsers" + index;
		    if (document.getElementById(idHidden) != null) {
		        document.getElementById("LabelQTUserLimit").innerHTML = STSHtmlEncode(document.getElementById(idHidden).value);
		    }
		}
    }
    function SitePrefixChanged()
    {
        ULS9xi:;
        var i = (document.getElementById("<%= DdlHostHeaderPrefixes.ClientID %>")).selectedIndex;
		var bUseWildcardInclusion = false;
		var inclusionList = (document.getElementById("<%= DdlHostHeaderPrefixes.ClientID %>")).options;

		if(i >= 0 && inclusionList.length > i)
		{
			bUseWildcardInclusion = inclusionList[i].value.substring(0,1) == "0";
		}

		var siteUrlSuffix = document.getElementById("<%= TxtSiteUrlSuffix.ClientID %>");
        
        if (!bUseWildcardInclusion)
		{
            siteUrlSuffix.style.display = 'none';
		}
		else
		{
            siteUrlSuffix.style.display = '';
		}

        STSValidatorEnable("<%= ReqSiteUrlSuffix.ClientID %>", bUseWildcardInclusion, true);
    }
	function _spBodyOnLoad() {
	    ULS9xi:;
	    if ((document.getElementById("<%= DdlQuotaTemplate.ClientID %>")) != null)
        {
            OnQuotaTemplateChange();
        }
	        
        if ((document.getElementById("<%= DdlHostHeaderPrefixes.ClientID %>")) != null)
        {
            SitePrefixChanged();
        }
    }
    function _spFormOnSubmit() {
        ULS9xi:;
        (document.getElementById("<%= BtnCreateSite.ClientID %>")).disabled = true;
        (document.getElementById("<%= BtnCreateSiteTop.ClientID %>")).disabled = true;
    }
    // ]]>
</script>
</asp:content>
<asp:content contentplaceholderid="PlaceHolderPageDescription" runat="server">
	<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_pagedescription%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
</asp:content>
<asp:content contentplaceholderid="PlaceHolderMain" runat="server">
  <asp:literal id="LiteralHiddenQuotaTemplates" runat="server"/>
   <table width="100%" class="propertysheet" cellspacing="0" cellpadding="0" border="0"> <tr> <td class="ms-descriptionText"> <asp:Label ID="LabelMessage" Runat="server" EnableViewState="False" class="ms-descriptionText"/> </td> </tr> <tr> <td class="ms-error"><asp:Label ID="LabelErrorMessage" Runat="server" EnableViewState="False" /></td> </tr> <tr> <td class="ms-descriptionText"> <asp:ValidationSummary ID="ValSummary" HeaderText="<%$SPHtmlEncodedResources:spadmin, ValidationSummaryHeaderText%>" DisplayMode="BulletList" ShowSummary="True" runat="server"> </asp:ValidationSummary> </td> </tr> </table>
   <%=HideLeftNavString%>
   <table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
	<wssuc:ButtonSection runat="server" TopButtons="true" BottomSpacing="5" ShowSectionLine="false" ShowStandardCancelButton="false">
		<Template_Buttons>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnCreateSite_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" id="BtnCreateSiteTop" accesskey="<%$Resources:wss,okbutton_accesskey%>" Enabled="false"/>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnCancel_Click" Text="<%$Resources:wss,multipages_cancelbutton_text%>" id="BtnCancelTop" accesskey="<%$Resources:wss,cancelbutton_accesskey%>" CausesValidation="false"/>
		</Template_Buttons>
	</wssuc:ButtonSection>
	<wssuc:InputFormSection Title="<%$Resources:spadmin, multipages_webapplication_title%>" runat="server" id="idWebApplicationSelectorSection">
		<Template_Description>
		   <SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, multipages_webapplication_desc%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
		   <br /><br />
		   <SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_webapp_desc1%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<a id="LinkCreateWebApplication" href="/_admin/extendvs.aspx"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_webapp_desc2%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/></a>
		  <SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_webapp_desc3%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
	   </Template_Description>
		<Template_InputFormControls>
			<tr><td>
			<SharePoint:WebApplicationSelector id="Selector" runat="server"
				OnContextChange="OnContextChange" AllowAdministrationWebApplication="false" />
			</td></tr>
		</Template_InputFormControls>
	</wssuc:InputFormSection>
	<wssuc:InputFormSection runat="server"
		Title="<%$Resources:spadmin, createsite_idInputTitleTitleDesc%>"
		Description="<%$Resources:spadmin, createsite_idInputDescriptionTitleDesc%>"
		id="idTitleDescSection">
		<Template_InputFormControls>
			<wssuc:InputFormControl runat="server"
				LabelText="<%$Resources:spadmin, createsite_idInputLabelTitle%>">
				<Template_Control>
					<wssawc:InputFormTextBox title="<%$Resources:spadmin, createsite_TxtCreateSiteTitle_title%>" CssClass="ms-input" ID="TxtCreateSiteTitle" Columns="35" Runat="server" MaxLength=255 />
					<wssawc:InputFormRequiredFieldValidator
						ID="ReqValTxtCreateSiteTitle"
						ControlToValidate="TxtCreateSiteTitle"
						ErrorMessage="<%$Resources:spadmin, createsite_titlerequired%>"
						Runat="server"/>
				</Template_Control>
			</wssuc:InputFormControl>
			<wssuc:InputFormControl runat="server"
				LabelText="<%$Resources:spadmin, multipages_description%>">
				<Template_Control>
					<wssawc:InputFormTextBox title="<%$Resources:spadmin, createsite_TxtCreateSiteDescription_title%>" class="ms-input" ID="TxtCreateSiteDescription" Runat="server" TextMode="MultiLine" Columns="40" Rows="3"/>
				</Template_Control>
			</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>
	<wssuc:InputFormSection Title="<%$Resources:spadmin, createsite_siteadr_title%>" runat="server">
		<Template_Description>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urldescription%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
            <p>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urldescription1%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<a id="ManagedPath" href="/_admin/SharePointHNSC/managedpath.aspx"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urldescription2%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/></a>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urldescription3%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
		</Template_Description>
		<Template_InputFormControls>
			<wssuc:InputFormControl runat="server" LabelText="<%$Resources:spadmin, createsite_idUrl%>">
				<Template_Control>
				<table dir="ltr" border="0" width="100%" cellspacing="0" cellpadding="0" class="authoringcontrols">
					<tr>
						<td class="ms-descriptiontext" nowrap="nowrap" width="100%">
                            <b id="SpanUrlProtocol" runat="server"></b>
							<wssawc:InputFormTextBox title="<%$Resources:spadmin, createsite_sitename%>" class="ms-input" ID="TxtSiteUrl" Columns="25" TextMode="SingleLine" Runat="server" MaxLength="255" />
                            <asp:DropDownList id="DdlHostHeaderPrefixes" runat="server"
								Title="<%$Resources:spadmin, createsite_siteprefix_title%>" onchange="SitePrefixChanged()"/>
                            <wssawc:InputFormTextBox title="<%$Resources:spadmin, createsite_sitename%>" class="ms-input" ID="TxtSiteUrlSuffix" Columns="15" TextMode="SingleLine" Runat="server" MaxLength="255" />
                            <wssawc:InputFormCustomValidator ID="CusValSiteUrl" Runat="server" Display="Dynamic" SetFocusOnError="true"
                                ControlToValidate="TxtSiteUrl"
                                ErrorMessage="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urlvalid%>"
                                OnServerValidate="ValSiteUrl_ServerValidate"
                                ValidateEmptyText="True" />
                            <wssawc:InputFormRequiredFieldValidator ID="ReqSiteUrl" ControlToValidate="TxtSiteUrl"
								ErrorMessage="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urlrequired%>" Runat="server"/>
                            <wssawc:InputFormRequiredFieldValidator ID="ReqSiteUrlSuffix" ControlToValidate="TxtSiteUrlSuffix" Enabled="false"
								ErrorMessage="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_urlsuffixrequired%>" Runat="server" EnableClientScript="true"/>
						</td>
					</tr>
				</table>
				</Template_Control>
			</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>
	<wssuc:TemplatePickerControl id="InputFormTemplatePickerControl" runat="server"
		TemplateTypesToShow="RootWeb"
		HonorVisibilityFeatureDependencies="false"
		ShowCustomTemplates="false" />
	<wssuc:InputFormSection
		Title="<%$Resources:spadmin, createsite_idWebAdminHeader%>"
		Description= "<%$Resources:spadmin, Site_idWebAdminDescription%>"
		runat="server"
		id="idPrimaryAdministratorSection">
		<Template_InputFormControls>
				<wssuc:InputFormControl LabelText="<%$Resources:spadmin, createsite_idOwnerLogin%>"
					runat="server">
					<Template_Control>
						<wssawc:PeopleEditor
						  AllowEmpty=false
						  SingleLine=true
						  ValidatorEnabled="true"
						  MultiSelect=false
						  id="PickerOwner"
						  runat="server"
						  SelectionSet="User"
						  />
					</Template_Control>
				</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>
	<wssuc:InputFormSection Title="<%$Resources:spadmin, createsite_ContactHeader%>"
		Description="<%$Resources:spadmin, Site_ContactDescription%>"
		runat="server"
		id="idSecondaryAdministratorSection">
		<Template_InputFormControls>
				<wssuc:InputFormControl LabelText="<%$Resources:spadmin, createsite_ContactLogin%>"
					runat="server">
					<Template_control>
						<wssawc:PeopleEditor
						  SingleLine=true
						  ValidatorEnabled="true"
						  MultiSelect=false
						  id="PickerOwner2"
						  runat="server"
						  SelectionSet="User"
						  />
					</Template_control>
				</wssuc:InputFormControl>
		</Template_InputFormControls>
	</wssuc:InputFormSection>

	<wssuc:InputFormSection Title="<%$Resources:spadmin, createsite_QuotaHeader%>" runat="server" id="idQuotaSection">
		<Template_description>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_quota_desc1%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<p>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_quota_desc2%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<a id="ManageQuotaTemplate" href="/_admin/ManageQuotaTemplate.aspx"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_quota_desc3%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/></a>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_quota_desc4%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
		</Template_description>
		<Template_InputFormControls>
			 <tr>
			   <td>
				 <label for=<%SPHttpUtility.WriteAddQuote(SPHttpUtility.NoEncode(DdlQuotaTemplate.ClientID),this.Page);%>><SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_SelectQuotaTemplate%>" EncodeMethod='HtmlEncode'/></label>
			   </td>
			 </tr>
			 <tr>
			   <td><img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='3' style="display: block" alt="" /></td>
			 </tr>
			 <tr>
			   <td>
				 <img src="/_layouts/15/images/blank.gif?rev=23" width='8' height='1' alt="" /><asp:DropDownList id="DdlQuotaTemplate" runat="server" onchange="OnQuotaTemplateChange()"/>
			   </td>
			 </tr>
			 <tr><td>
			   <table class="ms-authoringcontrols" width="100%" cellpadding=0 cellspacing=4 border=0>
				 <tr>
				   <td><SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_idQTStorageLimit%>" EncodeMethod='HtmlEncode'/></td>
				   <td><label id="LabelQTStorageLimit" name="LabelQTStorageLimit"/></td>
				 </tr>
				 <tr>
				   <td><SharePoint:EncodedLiteral runat="server" text="<%$Resources:spadmin, createsite_idQTUserLimit%>" EncodeMethod='HtmlEncode'/> </td>
				   <td><label id="LabelQTUserLimit" name="LabelQTUserLimit"/></td>
				 </tr>
			   </table>
			 </td></tr>
		</Template_InputFormControls>
	</wssuc:InputFormSection>

    <wssuc:InputFormSection Title="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_ContentDatabaseHeader%>" runat="server" id="idContentDatabaseSection">
		<Template_description>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_ContentDatabase_desc1%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<p>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_ContentDatabase_desc2%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
			<a id="AddContentDatabase" href="/_admin/newcntdb.aspx"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_ContentDatabase_desc3%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/></a>
			<SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_ContentDatabase_desc4%>" EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
		</Template_description>
		<Template_InputFormControls>
			 <tr>
			   <td>
				 <label for=<%SPHttpUtility.WriteAddQuote(SPHttpUtility.NoEncode(DdlContentDatabase.ClientID), this.Page);%>><SharePoint:EncodedLiteral runat="server" text="<%$Resources:SharePointHNSC.spadmin, createhostnamedsite_SelectContentDatabase%>" EncodeMethod='HtmlEncode'/></label>
			   </td>
			 </tr>
			 <tr>
			   <td><img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='3' style="display: block" alt="" /></td>
			 </tr>
			 <tr>
			   <td>
				 <img src="/_layouts/15/images/blank.gif?rev=23" width='8' height='1' alt="" /><asp:DropDownList id="DdlContentDatabase" runat="server" onchange=""/>
			   </td>
			 </tr>
		</Template_InputFormControls>
	</wssuc:InputFormSection>

	<SharePoint:DelegateControl runat="server" Id="DelctlCreateSiteCollectionPanel" ControlId="CreateSiteCollectionPanel1" Scope="Farm" />
	<wssuc:ButtonSection runat="server" ShowStandardCancelButton="false">
		<Template_Buttons>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnCreateSite_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" id="BtnCreateSite" accesskey="<%$Resources:wss,okbutton_accesskey%>" Enabled="false"/>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="BtnCancel_Click" Text="<%$Resources:wss,multipages_cancelbutton_text%>" id="BtnCancel" accesskey="<%$Resources:wss,cancelbutton_accesskey%>" CausesValidation="false"/>
		</Template_Buttons>
	</wssuc:ButtonSection>
   </table>
  </asp:content>
